<extend name="Public/base" />

<block name="body">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
	<!-- 标题栏 -->
		<div class="tab-wrap">
		<div class="tab-content">
	<!-- 修改密码表单 -->
    <form action="{:U('')}" method="post" class="form-horizontal" autocomplete="off">
		<div class="form-item">
            <label class="item-label">图片上传<span class="check-tips"></span></label>
            <div class="controls">
                <input type="file" id="upload_picture_1">
                <div class="upload-img-box">
                </div>
            </div>
            <script type="text/javascript">
            //上传图片
            /* 初始化上传插件 */
            $("#upload_picture_1").uploadify({
                "height"          : 30,
                "swf"             : "__STATIC__/uploadify/uploadify.swf",
                "fileObjName"     : "download",
                "buttonText"      : "上传图片",
                "uploader"        : "{:U('File/buploadPicture',array('session_id'=>session_id()))}",
                "width"           : 120,
                'removeTimeout'	  : 1,
                'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
                "onUploadSuccess" : uploadPicture1,
                'onFallback' : function() {
                    alert('未检测到兼容版本的Flash.');
                }
            });
            function uploadPicture1(file, data){
                var data = $.parseJSON(data);
                var src = '';
                if(data.status){
                    $("#fileContent").val(data.fileJson);
                    src = data.url || '__ROOT__' + data.path;
                    $("#upload_picture_1").parent().find('.upload-img-box').html(
                        '<div class="upload-pre-item"><img src="' + src + '"/></div>'
                    );
                } else {
                    updateAlert(data.info);
                    setTimeout(function(){
                        $('#top-alert').find('button').click();
                    },1500);
                }
            }
            </script>
        </div>
        <div class="form-item">
            <label class="item-label">文件上传<span class="check-tips"></span></label>
            <div class="controls">
                    <input type="file" id="upload_file_2">
                    <div class="upload-img-box">
                    </div>
                </div>
                <script type="text/javascript">
                //上传图片
                /* 初始化上传插件 */
                $("#upload_file_2").uploadify({
                    "height"          : 30,
                    "swf"             : "__STATIC__/uploadify/uploadify.swf",
                    "fileObjName"     : "download",
                    "buttonText"      : "上传附件",
                    "uploader"        : "{:U('File/bupload',array('session_id'=>session_id()))}",
                    "width"           : 120,
                    'removeTimeout'	  : 1,
                    "onUploadSuccess" : uploadFile2,
                    'onFallback' : function() {
                        alert('未检测到兼容版本的Flash.');
                    }
                });
                function uploadFile2(file, data){
                    var data = $.parseJSON(data);
                    if(data.status){
                        $("#fileContent").val(data.fileJson);
                        $("#upload_file_2").parent().find('.upload-img-box').html(
                            "<div class=\"upload-pre-file\"><span class=\"upload_icon_all\"></span>" + data.info + "</div>"
                        );
                    } else {
                        updateAlert(data.info);
                        setTimeout(function(){
                            $('#top-alert').find('button').click();
                        },1500);
                    }
                }
                </script>
        </div>
        <div class="form-item">
			<label class="item-label">File<span class="check-tips"></span></label>
			<div class="controls">
				<label class="textarea input-large">
                    <textarea id="fileContent">
{
    "__type": "File",
    "group": "group1",
    "filename": "1.xml",
    "url": "M00/01/14/sd2lkds0.xml"
}
                    </textarea>
                </label>
			</div>
		</div>
        <div class="form-item">
			<label class="item-label">Date<span class="check-tips"></span></label>
			<div class="controls">
				<label class="textarea input-large">
                    <textarea>
{
    "__type": "Date",
    "iso": "2011-08-21 18:02:52"
}</textarea>
                </label>
			</div>
		</div>
        <div class="form-item">
			<label class="item-label">Geopoint<span class="check-tips"></span></label>
			<div class="controls">
				<label class="textarea input-large">
                    <textarea>
{
    "__type": "GeoPoint",
    "latitude": 50.934755,
    "longitude": 24.52065
}
                    </textarea>
                </label>
			</div>
		</div>
        <div class="form-item">
			<label class="item-label">Pointer<span class="check-tips"></span></label>
			<div class="controls">
				<label class="textarea input-large">
                    <textarea>
{
  "__type": "Pointer",
  "className": "Game",
  "objectId": "DdUOIIIW"
}
                    </textarea>
                </label>
			</div>
		</div>
        <div class="form-item">
			<label class="item-label">Array<span class="check-tips"></span></label>
			<div class="controls">
				<label class="textarea input-large">
                    <textarea>
{"__op":"Add","objects":["person1","person2"]}

                    </textarea>
                </label>
			</div>
		</div>
        <div class="form-item">
			<label class="item-label">Object<span class="check-tips"></span></label>
			<div class="controls">
				<label class="textarea input-large">
                    <textarea>
{
  "__type": "Object",
  "className": "Post",
  "objectId": "51e3a359e4b015ead4d95ddc",
  "createdAt": "2011-12-06T20:59:34.428Z",
  "updatedAt": "2011-12-06T20:59:34.428Z",
  "otherFields": "willAlsoBeIncluded"
}
                    </textarea>
                </label>
			</div>
		</div>
        <div class="form-item">
			<label class="item-label">Relation<span class="check-tips"></span></label>
			<div class="controls">
				<label class="textarea input-large">
                    <textarea>
{
  "__type": "Relation",
  "className": "GameScore"
}
                    </textarea>
                </label>
			</div>
		</div>
	</form>
			</div>
	</div>
</block>

<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

</block>
